<?php
// $ft_list=$data['noveltype'];
// $hits_list=$data['novelhittimes'];
// $f_list=$data['novelinfor'];
// $novel_list=$data['novellist'];
$c_list=$data1;
?>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="">
  <meta name="author" content="">
  <link rel="icon" href="../../favicon.ico">

  <title>选课系统</title>

  <!-- Bootstrap core CSS -->
  <link href="assets/css/bootstrap.min.css" rel="stylesheet">

  <!-- Custom styles for this template -->
  <link href="assets/css/offcanvas.css" rel="stylesheet">
  <link href="assets/css/style.css" rel="stylesheet">
  <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
  <!--[if lt IE 9]>
  <script src="assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
  <script src="assets/js/ie-emulation-modes-warning.js"></script>

  <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  <!--[if lt IE 9]>
  <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>

<body>
  <nav class="navbar navbar-fixed-top navbar-inverse">
    <div class="container-fluid">
      <!-- Brand and toggle get grouped for better mobile display -->
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>

      </div>

      <!-- Collect the nav links, forms, and other content for toggling -->
      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
        <ul class="nav navbar-nav">
          <li><a href="index.php">首页 <span class="sr-only">(current)</span></a></li>
          <?php
          foreach ($data1 as $one)
          {
            echo '<li><a href="index.php?c=index&m=lists&ctid='.$one['id'].'">'.$one['ctype'].'</a></li>';
          }
          ?>
          <!-- <li><a href="list.php?tid=1">电影</a></li>
          <li><a href="list.php?tid=2">电视剧</a></li>
          <li><a href="list.php?tid=3">动画片</a></li>
          <li class="dropdown">
          <a href="list.php?tid=4" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">原创 <span class="caret"></span></a>
          <ul class="dropdown-menu">
          <li><a href="#">喜剧</a></li>
          <li><a href="#">科幻</a></li>
          <li><a href="#">教育</a></li>
          <li role="separator" class="divider"></li>
          <li><a href="#">其他</a></li>
        </ul>
      </li> -->
    </ul>

    <ul class="nav navbar-nav navbar-right">
      <li class="active">
        <ul class="nav navbar-nav navbar-right">
          <li class="active">
            <a href="">欢迎
              <?php
              session_start();
              if(isset($_SESSION["user"]))
              echo " ".$_SESSION["user"]." ";
              else
              echo "您";
              ?>
              访问本网站</a>
            </li>
            <?php
            //登录成功才显示
            if(isset($_SESSION["user"]))
            {
              ?>




              <div class="modal fade" id="changeInfor" abindex="-1" role="dialog" aria-labelledby="myModalLabel">
                <div class="modal-dialog" role="document">
                  <div class="modal-content">


                  </div>
                </div>
              </div>

              <li><a href="logout.php">注销</a></li>
              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                aria-haspopup="true" aria-expanded="false">个人中心 <span class="caret"></span></a>
                <ul class="dropdown-menu">
                  <li><a href="#" data-toggle="modal" data-target="#changePassword">修改个人密码</a></li>
                  <li><a href="index.php?c=index&m=chooselist" data-toggle="modal" data-target="#changeInfor">查看已选课程</a></li>

                </ul>

              </li>

              <?php } else{ ?>

                <li><a href="#" data-toggle="modal" data-target="#login">登录</a></li>


                <div class="modal fade" id="login" tabindex="-1" role="dialog"
                aria-labelledby="myModalLabel">
                <div class="modal-dialog" role="document">
                  <div class="modal-content">
                    <div class="modal-header">
                      <button type="button" class="close" data-dismiss="modal"
                      aria-label="Close"><span aria-hidden="true">&times;</span></button>
                      <h4 class="modal-title" id="myModalLabel">请填写普通用户登录信息</h4>
                    </div>
                    <div class="modal-body">
                      <form name="fm" method="post" action="doLogin.php" onsubmit="return check()"
                      class="form-horizontal">
                      <?php
                      // show.php 页面传来的登录链接，需要带着 vid 参数，以便登陆成功后直接返回视频内容页
                      ?>
                      <input type="hidden" name="nid" id="novelid" >
                      <div class="form-group">
                        <label for="exampleInputUserName1" class="col-md-2 control-label">用户名</label>
                        <div class="col-md-4">
                          <input type="text" name="username" class="form-control" id="exampleInputUserName1"
                          placeholder="姓名" required>
                        </div>
                        <div class="col-md-6"></div>
                      </div>
                      <div class="form-group">
                        <label for="exampleInputPassword1" class="col-md-2 control-label">密码</label>
                        <div class="col-md-4">
                          <input type="password" name="pswd" class="form-control" id="exampleInputPassword1"
                          placeholder="密码" required>
                        </div><div class="col-md-6"></div>
                      </div>
                      <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                          <input type="submit" class="btn btn-default" value="登录">
                          <input type="reset" class="btn btn-default" value="重置">
                        </div>
                      </div>

                      <?php
                      if(isset($_GET["msg"]))
                      {
                        echo'<h1 style="color:red;">'.$_GET["msg"]."</h1>";
                      }
                      ?>
                      <?php
                      if(isset($_GET["msg9"]))
                      {
                        echo'<h1 style="color:red;">'.$_GET["msg9"]."</h1>";
                      }
                      ?>

                    </form>
                  </div>

                  <div class="modal-footer">
                    <button type="button" class="btn btn-default" onclick="location.replace('index.php')"
                    data-dismiss="modal">关闭</button>
                  </div>

                </div>
              </div>
            </div>

            <div class="modal fade" id="reg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
              <div class="modal-dialog" role="document">
                <div class="modal-content">
                  <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                    <h4 class="modal-title" id="myModalLabel">请填写用户注册信息</h4>
                  </div>
                  <div class="modal-body">




                  </div>
                  <div class="modal-footer">
                    <button type="button" class="btn btn-default" onclick="location.replace('index.php')" data-dismiss="modal">关闭</button>
                  </div>
                </div>
              </div>
            </div>

            <?php } ?>
          </ul>

        </ul>
      </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
  </nav>

  <!-- /.navbar -->


  <div class="container">

    <div class="row row-offcanvas row-offcanvas-right">

      <div class="col-xs-12 col-sm-9">


        <div class="row text-center">

          <div class="col-xs-12 col-lg-12 mlist">

            <table class="table table-hover">
            <tr>
              <th>课程名字</th>
              <th>任课教师</th>
              <th>课程学时</th>
            </tr>

           <?php
               foreach($data2 as $row){
                 echo '<tr>';
                 echo '<td>'.$row['coursename'].'</td>';
                 echo '<td>'.$row['teacher'].'</td>';
                 echo '<td>'.$row['coursetime'].'</td>';
                echo '<td><a href="index.php?c=index&m=choose&id='.$row['cid'].' ">选课</a></td>';

                 }

                 echo '</tr>';
             echo '</table>';

            ?>

            <nav class="text-center">
              <ul class="pagination">
                <li>
                  <a href="#" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                  </a>
                </li>
                <li><a href="#">1</a></li>
                <li><a href="#">2</a></li>
                <li><a href="#">3</a></li>
                <li><a href="#">4</a></li>
                <li><a href="#">5</a></li>
                <li>
                  <a href="#" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                  </a>
                </li>
              </ul>
            </nav>

          </div>
          <!-- <ul class="list-inline row text-center">
          <li class="col-xs-6 col-lg-3">
          <img src="images/5555.png" class="responsive img-thumbnail"/>
          <p><a href="show.php">老炮儿</a></p>
        </li>
        <li class="col-xs-6 col-lg-3">
        <img src="images/speed.jpg" class="responsive img-thumbnail"/>
        <p><a href="show.php">速度与激情</a></p>
      </li>
      <li class="col-xs-6 col-lg-3">
      <img src="images/special forces.jpg" class="responsive img-thumbnail"/>
      <p><a href="show.php">特种部队2（全面反击）</a></p>
    </li>
    <li class="col-xs-6 col-lg-3">
    <img src="images/forrest gump.jpg" class="responsive img-thumbnail"/>
    <p><a href="show.php">阿甘正传</a></p>
  </li>
  <li class="col-xs-6 col-lg-3">
  <img src="images/pianist.jpg" class="responsive img-thumbnail"/>
  <p><a href="show.php">海上钢琴师</a></p>
</li>
<li class="col-xs-6 col-lg-3">
<img src="images/The Shawshank Redemption.jpg" class="responsive img-thumbnail"/>
<p><a href="show.php">肖申克的救赎</a></p>
</li>
<li class="col-xs-6 col-lg-3">
<img src="images/a dogs story.jpg" class="responsive img-thumbnail"/>
<p><a href="show.php">忠犬八公的故事</a></p>
</li>
<li class="col-xs-6 col-lg-3">
<img src="images/happiness.jpeg" class="responsive img-thumbnail"/>
<p><a href="show.php">当幸福来敲门</a></p>
</li>
</ul>

</div>-->
<!--/.col-xs-6.col-lg-4-->

</div>
<!--/row-->
</div>
<!--/.col-xs-12.col-sm-9-->

<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar">
  <div class="list-group text-center">
    <h2 style="color:white;" >公告</h2>
    <ul class="list-inline row text-center">
      <h1><center>选课通知</center></h1>
      <table class="table table-hover">
      <tr>
        <th>选课日期</th>
        <th>选课时间</th>

      </tr>

     <?php

         foreach($data3 as $row){
           echo '<tr>';
           echo '<td>'.$row['date'].'</td>';
           echo '<td>'.$row['time'].'</td>';
           }

           echo '</tr>';
       echo '</table>';

      ?>
        <!-- <div class="col-xs-6 col-sm-3 sidebar-offcanvas">
        <div class="list-group text-center" id="sidebar">
        <h2 style="color:white;">下载排行</h2>
        <ul class="list-inline row text-center">
        <li class="col-xs-12 col-lg-6">
        <img src="images/pianist.jpg" class="responsive img-thumbnail"/>
        <p><a href="show.php">海上钢琴师</a></p>
      </li>
      <li class="col-xs-12 col-lg-6">
      <img src="images/happiness.jpeg" class="responsive img-thumbnail"/>
      <p><a href="show.php">当幸福来敲门</a></p>
    </li>
    <li class="col-xs-12 col-lg-6">
    <img src="images/forrest gump.jpg" class="responsive img-thumbnail"/>
    <p><a href="show.php">阿甘正传</a></p>
  </li>
  <li class="col-xs-12 col-lg-6">
  <img src="images/a dogs story.jpg" class="responsive img-thumbnail"/>
  <p><a href="show.php">忠犬八公的故事</a></p>
</li>-->

</ul>
</div>
</div>
<!--/.sidebar-offcanvas-->
</div>
<!--/row-->



</div>
<!--/.container-->
<hr>
<footer>
  <a href="admin.php">


    Administrators235</a>
  </footer>

  <!-- Bootstrap core JavaScript
  ================================================== -->
  <!-- Placed at the end of the document so the pages load faster -->
  <script src="assets/js/jquery.min.js"></script>
  <script src="assets/js/bootstrap.min.js"></script>

  <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  <script src="assets/js/ie10-viewport-bug-workaround.js"></script>

  <script src="offcanvas.js"></script>
</body>
</html>
